<template>
  <div >
    <div style="font-size:20px;text-align:left">
      <i class="el-icon-document-checked">检验结果录入</i>
    </div>
    <el-divider></el-divider>

    <el-row :gutter="20">
      <el-col :span="6"><el-input v-model="input_patient_id" placeholder="请输入患者病历号"></el-input></el-col>
      <el-col :span="6"><el-input v-model="input_patient_name" placeholder="请输入患者姓名"></el-input></el-col>      
      <el-col :span="2"><el-button @click="getWaitCheck(1)">搜索</el-button></el-col>
      <el-col :span="10"> </el-col>
    </el-row>
    
    <el-table
      :data="wait_check"      style="margin-top:5px;width: 80%">
      <el-table-column        type="index"     label="编号"        width="80"></el-table-column>
      <el-table-column        prop="real_name"        label="患者姓名"        width="180"></el-table-column>
      <el-table-column        prop="case_number"        label="患者病历号">     </el-table-column>
      <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button   size="mini" @click="createCheckApply(scope.$index, scope.row)">已完成检验</el-button>
      </template>
    </el-table-column>
    </el-table>
    <div style="margin-top:5px;text-align:right;width:80%">
      <el-pagination 
      :page-size="pageSize" :total="totalCount" @current-change="wait_patient_table_change"
      layout="prev, pager, next">
    </el-pagination>
    </div>
    <el-divider></el-divider>

    <el-table :data="check_patient_table" style="width:80%;margin-top:20px" highlight-current-row @current-change="checkSelectionChange">
      <el-table-column type="index" width="50"></el-table-column>
      <el-table-column prop="item_code" label="检查编码"></el-table-column>
      <el-table-column prop="item_name" label="检查名称"></el-table-column>
      <el-table-column prop="item_format" label="检查规格"></el-table-column>
      <el-table-column prop="item_price" label="单价"></el-table-column>
      <el-table-column prop="item_type" label="费用分类"></el-table-column>
    </el-table>
    <div align="left">
      <el-tag>已选择的检查项目：{{ checkPatient.item_name }}</el-tag>
    </div>
    <el-divider></el-divider>

    <el-descriptions title="选择输入检验医生" :column="2" border style="margin-top:20px;width:50%">
      <el-descriptions-item label="科室选择">
        <el-select v-model="deptment_id" placeholder="选择科室" @change="deptChange">
          <el-option v-for="item in check_dept" :key="item.id" :label="item.dept_name" :value="item.id">
          </el-option>
        </el-select>
      </el-descriptions-item>
      <el-descriptions-item label="医生选择">
        <el-select v-model="employee_id" placeholder="选择医生">
          <el-option v-for="item in check_employee" :key="item.id" :label="item.realname" :value="item.id">
          </el-option>
        </el-select>
      </el-descriptions-item>
    </el-descriptions>

    <el-descriptions title="输入检验结果" :column="1" border style="margin-top:20px;width:80%">
      <el-descriptions-item label="检验结果" :labelStyle="{'width':'120px'}">
        <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" v-model="proposal" placeholder="请输入检验结果"></el-input>
      </el-descriptions-item>
      
    </el-descriptions>
    <div style="text-align:left;margin-top:20px">
      <el-button type="primary" @click="addCheckPatient()">结果提交</el-button>
      <el-button type="primary" @click="clearCheckPatient()">重置输入</el-button>
    </div>
  </div>
</template>
<script>
import {isNullMessage} from "../../util/util";
import qs from 'qs';
export default{
  data(){
    return{
      checkPatient:{
        inspection_employee_id:'',
        id:'',
        item_name:''
      },
      employee_id:'',//选择医生id
      check_employee:[],//检查科室医生列表
      deptment_id:'',//选择科室id
      check_dept:[],//检查科室列表
      check_patient_table:[],//患者的检查项目列表
      patient:{},//患者信息
      proposal:'' // 检验结果结果

    }    
  },
  methods:{

  },
  mounted() {
  }
}
</script>
